

package com.hazelcast.map.impl;

import com.hazelcast.client.impl.protocol.task.map.MapAssignAndGetUuidsOperation;
import com.hazelcast.client.impl.protocol.task.map.MapAssignAndGetUuidsOperationFactory;
import com.hazelcast.internal.iteration.IndexIterationPointer;
import com.hazelcast.internal.monitor.impl.LocalRecordStoreStatsImpl;
import com.hazelcast.internal.nearcache.impl.invalidation.BatchNearCacheInvalidation;
import com.hazelcast.internal.nearcache.impl.invalidation.SingleNearCacheInvalidation;
import com.hazelcast.internal.serialization.DataSerializerHook;
import com.hazelcast.internal.serialization.impl.ArrayDataSerializableFactory;
import com.hazelcast.internal.serialization.impl.FactoryIdHelper;
import com.hazelcast.map.impl.iterator.MapEntriesWithCursor;
import com.hazelcast.map.impl.iterator.MapKeysWithCursor;
import com.hazelcast.map.impl.journal.*;
import com.hazelcast.map.impl.nearcache.invalidation.UuidFilter;
import com.hazelcast.map.impl.operation.*;
import com.hazelcast.map.impl.operation.MapFetchIndexOperation.MapFetchIndexOperationResult;
import com.hazelcast.map.impl.operation.MapGetInvalidationMetaDataOperation.MetaDataResponse;
import com.hazelcast.map.impl.operation.PostJoinMapOperation.InterceptorInfo;
import com.hazelcast.map.impl.query.*;
import com.hazelcast.map.impl.querycache.accumulator.AccumulatorInfo;
import com.hazelcast.map.impl.querycache.accumulator.ConsumeAccumulatorOperation;
import com.hazelcast.map.impl.querycache.subscriber.operation.*;
import com.hazelcast.map.impl.tx.*;
import com.hazelcast.nio.serialization.DataSerializableFactory;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.query.impl.MapIndexInfo;

import java.util.function.Supplier;

import static com.hazelcast.internal.serialization.impl.FactoryIdHelper.MAP_DS_FACTORY;
import static com.hazelcast.internal.serialization.impl.FactoryIdHelper.MAP_DS_FACTORY_ID;

@SuppressWarnings({"ClassDataAbstractionCoupling", "checkstyle:classfanoutcomplexity"})
public final class MapDataSerializerHook implements DataSerializerHook {

    public static final int F_ID = FactoryIdHelper.getFactoryId(MAP_DS_FACTORY, MAP_DS_FACTORY_ID);

    public static final int PUT = 0;
    public static final int GET = 1;
    public static final int REMOVE = 2;
    public static final int PUT_BACKUP = 3;
    public static final int REMOVE_BACKUP = 4;
    public static final int CREATE_ACCUMULATOR_INFO = 5;
    public static final int DATA_COLLECTION = 6;
    public static final int ENTRIES = 7;
    public static final int ENTRY_VIEW = 8;
    public static final int QUERY_RESULT_ROW = 9;
    public static final int QUERY_RESULT = 10;
    public static final int EVICT_BACKUP = 11;
    public static final int CONTAINS_KEY = 12;
    public static final int KEYS_WITH_CURSOR = 13;
    public static final int ENTRIES_WITH_CURSOR = 14;
    public static final int SET = 15;
    public static final int LOAD_MAP = 16;
    public static final int KEY_LOAD_STATUS = 17;
    public static final int LOAD_ALL = 18;
    public static final int ENTRY_BACKUP = 19;
    public static final int ENTRY_OPERATION = 20;
    public static final int PUT_ALL = 21;
    public static final int PUT_ALL_BACKUP = 22;
    public static final int REMOVE_IF_SAME = 23;
    public static final int REPLACE = 24;
    public static final int SIZE = 25;
    public static final int CLEAR_BACKUP = 26;
    public static final int CLEAR = 27;
    public static final int DELETE = 28;
    public static final int EVICT = 29;
    public static final int EVICT_ALL = 30;
    public static final int EVICT_ALL_BACKUP = 31;
    public static final int GET_ALL = 32;
    public static final int IS_EMPTY = 33;
    public static final int NEAR_CACHE_SINGLE_INVALIDATION = 34;
    public static final int NEAR_CACHE_BATCH_INVALIDATION = 35;
    public static final int IS_PARTITION_LOADED = 36;
    public static final int PARTITION_WIDE_ENTRY = 37;
    public static final int PARTITION_WIDE_ENTRY_BACKUP = 38;
    public static final int PARTITION_WIDE_PREDICATE_ENTRY = 39;
    public static final int PARTITION_WIDE_PREDICATE_ENTRY_BACKUP = 40;
    public static final int ADD_INDEX = 41;
    public static final int AWAIT_MAP_FLUSH = 42;
    public static final int CONTAINS_VALUE = 43;
    public static final int GET_ENTRY_VIEW = 44;
    public static final int FETCH_ENTRIES = 45;
    public static final int FETCH_KEYS = 46;
    public static final int FLUSH_BACKUP = 47;
    public static final int FLUSH = 48;
    public static final int MULTIPLE_ENTRY_BACKUP = 49;
    public static final int MULTIPLE_ENTRY = 50;
    public static final int MULTIPLE_ENTRY_PREDICATE_BACKUP = 51;
    public static final int MULTIPLE_ENTRY_PREDICATE = 52;
    public static final int NOTIFY_MAP_FLUSH = 53;
    public static final int PUT_IF_ABSENT = 54;
    public static final int PUT_FROM_LOAD_ALL = 55;
    public static final int PUT_FROM_LOAD_ALL_BACKUP = 56;
    public static final int QUERY_PARTITION = 57;
    public static final int QUERY_OPERATION = 58;
    public static final int PUT_TRANSIENT = 59;
    public static final int REPLACE_IF_SAME = 60;
    public static final int TRY_PUT = 61;
    public static final int TRY_REMOVE = 62;
    public static final int TXN_LOCK_AND_GET = 63;
    public static final int TXN_DELETE = 64;
    public static final int TXN_PREPARE = 65;
    public static final int TXN_PREPARE_BACKUP = 66;
    public static final int TXN_ROLLBACK = 67;
    public static final int TXN_ROLLBACK_BACKUP = 68;
    public static final int TXN_SET = 69;
    public static final int TXN_UNLOCK = 70;
    public static final int TXN_UNLOCK_BACKUP = 71;
    public static final int IS_PARTITION_LOADED_FACTORY = 72;
    public static final int ADD_INDEX_FACTORY = 73;
    public static final int CLEAR_FACTORY = 74;
    public static final int CONTAINS_VALUE_FACTORY = 75;
    public static final int EVICT_ALL_FACTORY = 76;
    public static final int IS_EMPTY_FACTORY = 77;
    public static final int KEY_LOAD_STATUS_FACTORY = 78;
    public static final int MAP_FLUSH_FACTORY = 79;
    public static final int MAP_GET_ALL_FACTORY = 80;
    public static final int LOAD_ALL_FACTORY = 81;
    public static final int PARTITION_WIDE_ENTRY_FACTORY = 82;
    public static final int PARTITION_WIDE_PREDICATE_ENTRY_FACTORY = 83;
    public static final int PUT_ALL_PARTITION_AWARE_FACTORY = 84;
    public static final int SIZE_FACTORY = 85;
    public static final int MULTIPLE_ENTRY_FACTORY = 86;
    public static final int ENTRY_EVENT_FILTER = 87;
    public static final int EVENT_LISTENER_FILTER = 88;
    public static final int PARTITION_LOST_EVENT_FILTER = 89;
    public static final int ADD_INTERCEPTOR = 90;
    public static final int MAP_REPLICATION = 91;
    public static final int POST_JOIN_MAP_OPERATION = 92;
    public static final int MAP_INDEX_INFO = 94;
    public static final int INTERCEPTOR_INFO = 95;
    public static final int REMOVE_INTERCEPTOR = 96;
    public static final int QUERY_EVENT_FILTER = 97;
    public static final int RECORD_INFO = 98;
    public static final int RECORD_REPLICATION_INFO = 99;
    public static final int UUID_FILTER = 100;
    public static final int MAP_TRANSACTION_LOG_RECORD = 101;
    public static final int VERSIONED_VALUE = 102;
    public static final int MAP_REPLICATION_STATE_HOLDER = 103;
    public static final int WRITE_BEHIND_STATE_HOLDER = 104;
    public static final int AGGREGATION_RESULT = 105;
    public static final int QUERY = 106;
    public static final int MAP_INVALIDATION_METADATA = 108;
    public static final int MAP_INVALIDATION_METADATA_RESPONSE = 109;
    public static final int MAP_NEAR_CACHE_STATE_HOLDER = 110;
    public static final int MAP_ASSIGN_AND_GET_UUIDS = 111;
    public static final int MAP_ASSIGN_AND_GET_UUIDS_FACTORY = 112;
    public static final int DESTROY_QUERY_CACHE = 113;
    public static final int MADE_PUBLISHABLE = 114;
    public static final int MADE_PUBLISHABLE_FACTORY = 115;
    public static final int PUBLISHER_CREATE = 116;
    public static final int READ_AND_RESET_ACCUMULATOR = 117;
    public static final int SET_READ_CURSOR = 118;
    public static final int ACCUMULATOR_CONSUMER = 119;
    public static final int LAZY_MAP_ENTRY = 120;
    public static final int TRIGGER_LOAD_IF_NEEDED = 121;
    public static final int IS_KEYLOAD_FINISHED = 122;
    public static final int REMOVE_FROM_LOAD_ALL = 123;
    public static final int ENTRY_REMOVING_PROCESSOR = 124;
    public static final int ENTRY_OFFLOADABLE_SET_UNLOCK = 125;
    public static final int LOCK_AWARE_LAZY_MAP_ENTRY = 126;
    public static final int FETCH_WITH_QUERY = 127;
    public static final int RESULT_SEGMENT = 128;
    public static final int EVICT_BATCH_BACKUP = 129;
    public static final int EVENT_JOURNAL_SUBSCRIBE_OPERATION = 130;
    public static final int EVENT_JOURNAL_READ = 131;
    public static final int EVENT_JOURNAL_DESERIALIZING_MAP_EVENT = 132;
    public static final int EVENT_JOURNAL_INTERNAL_MAP_EVENT = 133;
    public static final int EVENT_JOURNAL_READ_RESULT_SET = 134;
    public static final int MERGE_FACTORY = 135;
    public static final int MERGE = 136;
    public static final int SET_TTL = 137;
    public static final int SET_TTL_BACKUP = 138;
    public static final int MERKLE_TREE_NODE_ENTRIES = 139;
    public static final int ADD_INDEX_BACKUP = 140;
    public static final int TXN_SET_BACKUP = 141;
    public static final int TXN_DELETE_BACKUP = 142;
    public static final int SET_WITH_EXPIRY = 143;
    public static final int PUT_WITH_EXPIRY = 144;
    public static final int PUT_TRANSIENT_WITH_EXPIRY = 145;
    public static final int PUT_IF_ABSENT_WITH_EXPIRY = 146;
    public static final int PUT_TRANSIENT_BACKUP = 147;
    public static final int COMPUTE_IF_PRESENT_PROCESSOR = 148;
    public static final int COMPUTE_IF_ABSENT_PROCESSOR = 149;
    public static final int KEY_VALUE_CONSUMING_PROCESSOR = 150;
    public static final int COMPUTE_MAP_OPERATION_PROCESSOR = 151;
    public static final int MERGE_MAP_OPERATION_PROCESSOR = 152;
    public static final int MAP_ENTRY_REPLACING_PROCESSOR = 153;
    public static final int LOCAL_RECORD_STORE_STATS = 154;
    public static final int MAP_FETCH_INDEX_OPERATION = 155;
    public static final int INDEX_ITERATION_POINTER = 156;
    public static final int MAP_FETCH_INDEX_OPERATION_RESULT = 157;
    public static final int MAP_CHUNK = 158;

    private static final int LEN = MAP_CHUNK + 1;

    @Override
    public int getFactoryId() {
        return F_ID;
    }

    @Override
    @SuppressWarnings("MethodLength")
    public DataSerializableFactory createFactory() {
        //noinspection unchecked
        Supplier<IdentifiedDataSerializable>[] constructors = new Supplier[LEN];

        constructors[PUT] = PutOperation::new;
        constructors[GET] = GetOperation::new;
        constructors[REMOVE] = RemoveOperation::new;
        constructors[PUT_BACKUP] = PutBackupOperation::new;
        constructors[REMOVE_BACKUP] = RemoveBackupOperation::new;
        constructors[EVICT_BACKUP] = EvictBackupOperation::new;
        constructors[CREATE_ACCUMULATOR_INFO] = AccumulatorInfo::new;
        constructors[DATA_COLLECTION] = DataCollection::new;
        constructors[ENTRIES] = MapEntries::new;
        constructors[ENTRY_VIEW] = () -> (IdentifiedDataSerializable) EntryViews.createSimpleEntryView();
        constructors[QUERY_RESULT_ROW] = QueryResultRow::new;
        constructors[QUERY_RESULT] = QueryResult::new;
        constructors[CONTAINS_KEY] = ContainsKeyOperation::new;
        constructors[KEYS_WITH_CURSOR] = MapKeysWithCursor::new;
        constructors[ENTRIES_WITH_CURSOR] = MapEntriesWithCursor::new;
        constructors[SET] = SetOperation::new;
        constructors[LOAD_MAP] = LoadMapOperation::new;
        constructors[KEY_LOAD_STATUS] = KeyLoadStatusOperation::new;
        constructors[LOAD_ALL] = LoadAllOperation::new;
        constructors[ENTRY_BACKUP] = EntryBackupOperation::new;
        constructors[ENTRY_OPERATION] = EntryOperation::new;
        constructors[PUT_ALL] = PutAllOperation::new;
        constructors[PUT_ALL_BACKUP] = PutAllBackupOperation::new;
        constructors[REMOVE_IF_SAME] = RemoveIfSameOperation::new;
        constructors[REPLACE] = ReplaceOperation::new;
        constructors[SIZE] = MapSizeOperation::new;
        constructors[CLEAR_BACKUP] = ClearBackupOperation::new;
        constructors[CLEAR] = ClearOperation::new;
        constructors[DELETE] = DeleteOperation::new;
        constructors[EVICT] = EvictOperation::new;
        constructors[EVICT_ALL] = EvictAllOperation::new;
        constructors[EVICT_ALL_BACKUP] = EvictAllBackupOperation::new;
        constructors[GET_ALL] = GetAllOperation::new;
        constructors[IS_EMPTY] = MapIsEmptyOperation::new;
        constructors[IS_PARTITION_LOADED] = IsPartitionLoadedOperation::new;
        constructors[PARTITION_WIDE_ENTRY] = PartitionWideEntryOperation::new;
        constructors[PARTITION_WIDE_ENTRY_BACKUP] = PartitionWideEntryBackupOperation::new;
        constructors[PARTITION_WIDE_PREDICATE_ENTRY] = PartitionWideEntryWithPredicateOperation::new;
        constructors[PARTITION_WIDE_PREDICATE_ENTRY_BACKUP] = PartitionWideEntryWithPredicateBackupOperation::new;
        constructors[ADD_INDEX] = AddIndexOperation::new;
        constructors[AWAIT_MAP_FLUSH] = AwaitMapFlushOperation::new;
        constructors[CONTAINS_VALUE] = ContainsValueOperation::new;
        constructors[GET_ENTRY_VIEW] = GetEntryViewOperation::new;
        constructors[FETCH_ENTRIES] = MapFetchEntriesOperation::new;
        constructors[FETCH_KEYS] = MapFetchKeysOperation::new;
        constructors[FLUSH_BACKUP] = MapFlushBackupOperation::new;
        constructors[FLUSH] = MapFlushOperation::new;
        constructors[MULTIPLE_ENTRY_BACKUP] = MultipleEntryBackupOperation::new;
        constructors[MULTIPLE_ENTRY] = MultipleEntryOperation::new;
        constructors[MULTIPLE_ENTRY_PREDICATE_BACKUP] = MultipleEntryWithPredicateBackupOperation::new;
        constructors[MULTIPLE_ENTRY_PREDICATE] = MultipleEntryWithPredicateOperation::new;
        constructors[NOTIFY_MAP_FLUSH] = NotifyMapFlushOperation::new;
        constructors[PUT_IF_ABSENT] = PutIfAbsentOperation::new;
        constructors[PUT_FROM_LOAD_ALL] = PutFromLoadAllOperation::new;
        constructors[PUT_FROM_LOAD_ALL_BACKUP] = PutFromLoadAllBackupOperation::new;
        constructors[QUERY_PARTITION] = QueryPartitionOperation::new;
        constructors[QUERY_OPERATION] = QueryOperation::new;
        constructors[PUT_TRANSIENT] = PutTransientOperation::new;
        constructors[REPLACE_IF_SAME] = ReplaceIfSameOperation::new;
        constructors[TRY_PUT] = TryPutOperation::new;
        constructors[TRY_REMOVE] = TryRemoveOperation::new;
        constructors[TXN_LOCK_AND_GET] = TxnLockAndGetOperation::new;
        constructors[TXN_DELETE] = TxnDeleteOperation::new;
        constructors[TXN_PREPARE] = TxnPrepareOperation::new;
        constructors[TXN_PREPARE_BACKUP] = TxnPrepareBackupOperation::new;
        constructors[TXN_ROLLBACK] = TxnRollbackOperation::new;
        constructors[TXN_ROLLBACK_BACKUP] = TxnRollbackBackupOperation::new;
        constructors[TXN_SET] = TxnSetOperation::new;
        constructors[TXN_UNLOCK] = TxnUnlockOperation::new;
        constructors[TXN_UNLOCK_BACKUP] = TxnUnlockBackupOperation::new;
        constructors[IS_PARTITION_LOADED_FACTORY] = IsPartitionLoadedOperationFactory::new;
        constructors[ADD_INDEX_FACTORY] = AddIndexOperationFactory::new;
        constructors[CLEAR_FACTORY] = ClearOperationFactory::new;
        constructors[CONTAINS_VALUE_FACTORY] = ContainsValueOperationFactory::new;
        constructors[EVICT_ALL_FACTORY] = EvictAllOperationFactory::new;
        constructors[IS_EMPTY_FACTORY] = IsEmptyOperationFactory::new;
        constructors[KEY_LOAD_STATUS_FACTORY] = KeyLoadStatusOperationFactory::new;
        constructors[MAP_FLUSH_FACTORY] = MapFlushOperationFactory::new;
        constructors[MAP_GET_ALL_FACTORY] = MapGetAllOperationFactory::new;
        constructors[LOAD_ALL_FACTORY] = MapLoadAllOperationFactory::new;
        constructors[PARTITION_WIDE_ENTRY_FACTORY] = PartitionWideEntryOperationFactory::new;
        constructors[PARTITION_WIDE_PREDICATE_ENTRY_FACTORY] = PartitionWideEntryWithPredicateOperationFactory::new;
        constructors[PUT_ALL_PARTITION_AWARE_FACTORY] = PutAllPartitionAwareOperationFactory::new;
        constructors[SIZE_FACTORY] = SizeOperationFactory::new;
        constructors[MULTIPLE_ENTRY_FACTORY] = MultipleEntryOperationFactory::new;
        constructors[ENTRY_EVENT_FILTER] = EntryEventFilter::new;
        constructors[EVENT_LISTENER_FILTER] = EventListenerFilter::new;
        constructors[PARTITION_LOST_EVENT_FILTER] = MapPartitionLostEventFilter::new;
        constructors[NEAR_CACHE_SINGLE_INVALIDATION] = SingleNearCacheInvalidation::new;
        constructors[NEAR_CACHE_BATCH_INVALIDATION] = BatchNearCacheInvalidation::new;
        constructors[ADD_INTERCEPTOR] = AddInterceptorOperation::new;
        constructors[MAP_REPLICATION] = MapReplicationOperation::new;
        constructors[POST_JOIN_MAP_OPERATION] = PostJoinMapOperation::new;
        constructors[MAP_INDEX_INFO] = MapIndexInfo::new;
        constructors[INTERCEPTOR_INFO] = InterceptorInfo::new;
        constructors[REMOVE_INTERCEPTOR] = RemoveInterceptorOperation::new;
        constructors[QUERY_EVENT_FILTER] = QueryEventFilter::new;
        constructors[UUID_FILTER] = UuidFilter::new;
        constructors[MAP_TRANSACTION_LOG_RECORD] = MapTransactionLogRecord::new;
        constructors[VERSIONED_VALUE] = VersionedValue::new;
        constructors[MAP_REPLICATION_STATE_HOLDER] = MapReplicationStateHolder::new;
        constructors[WRITE_BEHIND_STATE_HOLDER] = WriteBehindStateHolder::new;
        constructors[AGGREGATION_RESULT] = AggregationResult::new;
        constructors[QUERY] = Query::new;
        constructors[MAP_INVALIDATION_METADATA] = MapGetInvalidationMetaDataOperation::new;
        constructors[MAP_INVALIDATION_METADATA_RESPONSE] = MetaDataResponse::new;
        constructors[MAP_NEAR_CACHE_STATE_HOLDER] = MapNearCacheStateHolder::new;
        constructors[MAP_ASSIGN_AND_GET_UUIDS] = MapAssignAndGetUuidsOperation::new;
        constructors[MAP_ASSIGN_AND_GET_UUIDS_FACTORY] = MapAssignAndGetUuidsOperationFactory::new;
        constructors[DESTROY_QUERY_CACHE] = DestroyQueryCacheOperation::new;
        constructors[MADE_PUBLISHABLE] = MadePublishableOperation::new;
        constructors[MADE_PUBLISHABLE_FACTORY] = MadePublishableOperationFactory::new;
        constructors[PUBLISHER_CREATE] = PublisherCreateOperation::new;
        constructors[READ_AND_RESET_ACCUMULATOR] = ReadAndResetAccumulatorOperation::new;
        constructors[SET_READ_CURSOR] = SetReadCursorOperation::new;
        constructors[ACCUMULATOR_CONSUMER] = ConsumeAccumulatorOperation::new;
        constructors[LAZY_MAP_ENTRY] = LazyMapEntry::new;
        constructors[TRIGGER_LOAD_IF_NEEDED] = TriggerLoadIfNeededOperation::new;
        constructors[IS_KEYLOAD_FINISHED] = IsKeyLoadFinishedOperation::new;
        constructors[REMOVE_FROM_LOAD_ALL] = RemoveFromLoadAllOperation::new;
        constructors[ENTRY_REMOVING_PROCESSOR] = () -> EntryRemovingProcessor.ENTRY_REMOVING_PROCESSOR;
        constructors[ENTRY_OFFLOADABLE_SET_UNLOCK] = EntryOffloadableSetUnlockOperation::new;
        constructors[LOCK_AWARE_LAZY_MAP_ENTRY] = LockAwareLazyMapEntry::new;
        constructors[FETCH_WITH_QUERY] = MapFetchWithQueryOperation::new;
        constructors[RESULT_SEGMENT] = ResultSegment::new;
        constructors[EVICT_BATCH_BACKUP] = EvictBatchBackupOperation::new;
        constructors[EVENT_JOURNAL_SUBSCRIBE_OPERATION] = MapEventJournalSubscribeOperation::new;
        constructors[EVENT_JOURNAL_READ] = MapEventJournalReadOperation::new;
        constructors[EVENT_JOURNAL_DESERIALIZING_MAP_EVENT] = DeserializingEventJournalMapEvent::new;
        constructors[EVENT_JOURNAL_INTERNAL_MAP_EVENT] = InternalEventJournalMapEvent::new;
        constructors[EVENT_JOURNAL_READ_RESULT_SET] = MapEventJournalReadResultSetImpl::new;
        constructors[MERGE_FACTORY] = MergeOperationFactory::new;
        constructors[MERGE] = MergeOperation::new;
        constructors[SET_TTL] = SetTtlOperation::new;
        constructors[SET_TTL_BACKUP] = SetTtlBackupOperation::new;
        constructors[MERKLE_TREE_NODE_ENTRIES] = MerkleTreeNodeEntries::new;
        constructors[ADD_INDEX_BACKUP] = AddIndexBackupOperation::new;
        constructors[TXN_SET_BACKUP] = TxnSetBackupOperation::new;
        constructors[TXN_DELETE_BACKUP] = TxnDeleteBackupOperation::new;
        constructors[SET_WITH_EXPIRY] = SetWithExpiryOperation::new;
        constructors[PUT_WITH_EXPIRY] = PutWithExpiryOperation::new;
        constructors[PUT_TRANSIENT_WITH_EXPIRY] = PutTransientWithExpiryOperation::new;
        constructors[PUT_IF_ABSENT_WITH_EXPIRY] = PutIfAbsentWithExpiryOperation::new;
        constructors[PUT_TRANSIENT_BACKUP] = PutTransientBackupOperation::new;
        constructors[COMPUTE_IF_PRESENT_PROCESSOR] = ComputeIfPresentEntryProcessor::new;
        constructors[COMPUTE_IF_ABSENT_PROCESSOR] = ComputeIfAbsentEntryProcessor::new;
        constructors[KEY_VALUE_CONSUMING_PROCESSOR] = KeyValueConsumingEntryProcessor::new;
        constructors[COMPUTE_MAP_OPERATION_PROCESSOR] = ComputeEntryProcessor::new;
        constructors[MERGE_MAP_OPERATION_PROCESSOR] = MergeEntryProcessor::new;
        constructors[MAP_ENTRY_REPLACING_PROCESSOR] = MapEntryReplacingEntryProcessor::new;
        constructors[LOCAL_RECORD_STORE_STATS] = LocalRecordStoreStatsImpl::new;
        constructors[MAP_FETCH_INDEX_OPERATION] = MapFetchIndexOperation::new;
        constructors[INDEX_ITERATION_POINTER] = IndexIterationPointer::new;
        constructors[MAP_FETCH_INDEX_OPERATION_RESULT] = MapFetchIndexOperationResult::new;
        constructors[MAP_CHUNK] = MapChunk::new;

        return new ArrayDataSerializableFactory(constructors);
    }
}
